<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>商品信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/goods/goodsObj/">商品信息列表</a></li>
		<shiro:hasPermission name="goods:goodsObj:edit"><li><a href="${ctx}/goods/goodsObj/form">商品信息添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="goodsObj" action="${ctx}/goods/goodsObj/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>商品名称：</label>
				<form:input path="goodsName" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<%--<li><label>商品货号：</label>--%>
				<%--<form:input path="goodsNo" htmlEscape="false" maxlength="50" class="input-medium"/>--%>
			<%--</li>--%>
			<li><label>分类编号：</label>
				<sys:treeselect id="goodsCategory" name="parent.id" value="${goodsCategory.parent.id}" labelName="parent.name" labelValue="${goodsCategory.parent.categoryName}"
								title="分类" url="/goods/goodsCategory/treeData" extId="${goodsCategory.id}" cssClass="" notAllowSelectParent="true" allowClear="true"/>

				<%--<form:input path="categoryId" htmlEscape="false" maxlength="11" class="input-medium"/>--%>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>商品名称</th>
				<th>商品分类</th>
				<th>商品货号</th>
				<th>商品描述</th>
				<th>成本价</th>
				<th>售价</th>
                <th>供货商</th>
                <th>联系电话</th>
				<th>创建时间</th>
				<%--<th>更新时间</th>--%>

				<shiro:hasPermission name="goods:goodsObj:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="goodsObj">
			<tr>
				<td><a href="${ctx}/goods/goodsObj/form?id=${goodsObj.id}">
					${goodsObj.goodsName}
				</a></td>
				<td>
					${goodsObj.goodsCategory.categoryName}
				</td>
				<td>
					${goodsObj.goodsNo}
				</td>
				<td>
					${goodsObj.intro}
				</td>
				<td>
					${goodsObj.costPrice}
				</td>
				<td>
					${goodsObj.salePrice}
				</td>
                <td>
                     ${goodsObj.supplier}
                </td>
                <td>
                     ${goodsObj.supplierTel}
                </td>
				<td>
					<fmt:formatDate value="${goodsObj.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<%--<td>--%>
					<%--<fmt:formatDate value="${goodsObj.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>--%>
				<%--</td>--%>

				<shiro:hasPermission name="goods:goodsObj:edit"><td>
    				<a href="${ctx}/goods/goodsObj/form?id=${goodsObj.id}">修改</a>
					<a href="${ctx}/goods/goodsObj/delete?id=${goodsObj.id}" onclick="return confirmx('确认要删除该商品信息吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>